﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace FreeBroker
{
    public partial class MarkControl : UserControl
    {
        public MarkControl()
        {
            InitializeComponent();
            GraphicsPath path = new GraphicsPath();
            path.AddEllipse(0, 0, 10, 10);
            this.Region = new Region(path);
        }

        public Point Center
        {
            get { return new Point(Location.X + 5, Location.Y + 5); }
        }

        protected override void OnPaint(PaintEventArgs pevent)
        {
            Graphics g = pevent.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            Rectangle rect = new Rectangle(0, 0, 10, 10);
            LinearGradientBrush linearBrush = new LinearGradientBrush(rect, Color.FromArgb(40, 40, 40), this.ForeColor, 225);
            GraphicsPath path = new GraphicsPath();
            path.AddEllipse(rect);
            g.FillPath(linearBrush, path);
        }
    }
}
